home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / editors / emacs / xemacs / xemacs-1.004 / xemacs-1 / xemacs-19.13 / src / ndir.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-01  |  2.0 KB  |  71 lines

  1. /* This file is part of XEmacs.
  2.  
  3. XEmacs is free software; you can redistribute it and/or modify it
  4. under the terms of the GNU General Public License as published by the
  5. Free Software Foundation; either version 2, or (at your option) any
  6. later version.
  7.  
  8. XEmacs is distributed in the hope that it will be useful, but WITHOUT
  9. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10. FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  11. for more details.
  12.  
  13. You should have received a copy of the GNU General Public License
  14. along with XEmacs; see the file COPYING.  If not, write to the Free
  15. Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  16.  
  17. /* Synched up with: FSF 19.28. */
  18.  
  19. /*
  20.     <dir.h> -- definitions for 4.2BSD-compatible directory access
  21.  
  22.     last edit:    09-Jul-1983    D A Gwyn
  23. */
  24.  
  25. #ifdef VMS
  26. #ifndef FAB$C_BID
  27. #include <fab.h>
  28. #endif
  29. #ifndef NAM$C_BID
  30. #include <nam.h>
  31. #endif
  32. #ifndef RMS$_SUC
  33. #include <rmsdef.h>
  34. #endif
  35. #include "vms-dir.h"
  36. #endif /* VMS */
  37.  
  38. #define DIRBLKSIZ    512        /* size of directory block */
  39. #ifdef VMS
  40. #define MAXNAMLEN    (DIR$S_NAME + 7) /* 80 plus room for version #.  */
  41. #define MAXFULLSPEC    NAM$C_MAXRSS /* Maximum full spec */
  42. #else
  43. #define MAXNAMLEN    15        /* maximum filename length */
  44. #endif /* VMS */
  45.     /* NOTE:  MAXNAMLEN must be one less than a multiple of 4 */
  46.  
  47. struct direct                /* data from readdir() */
  48.     {
  49.     long        d_ino;        /* inode number of entry */
  50.     unsigned short    d_reclen;    /* length of this record */
  51.     unsigned short    d_namlen;    /* length of string in d_name */
  52.     char        d_name[MAXNAMLEN+1];    /* name of file */
  53.     };
  54.  
  55. typedef struct
  56.     {
  57.     int    dd_fd;            /* file descriptor */
  58.     int    dd_loc;            /* offset in block */
  59.     int    dd_size;        /* amount of valid data */
  60.     char    dd_buf[DIRBLKSIZ];    /* directory block */
  61.     }    DIR;            /* stream data from opendir() */
  62.  
  63. extern DIR *opendir (CONST char *filename)
  64. extern int closedir (DIR *dirp);
  65. extern struct direct *readdir (DIR *dirp);
  66. extern struct direct *readdirver (DIR *dirp);
  67. extern long telldir (DIR *dirp);
  68. extern void seekdir (DIR *dirp, long loc);
  69.  
  70. #define rewinddir( dirp )    seekdir( dirp, 0L )
  71.